<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
      <link rel="stylesheet" href="./../../helpwin.css">
      <title>MATLAB File Help: prtRvMultinomial/prtRvMultinomial</title>
   </head>
   <body>
      <!--Single-page help-->
      <table border="0" cellspacing="0" width="100%">
         <tr class="subheader">
            <td class="headertitle">MATLAB File Help: prtRvMultinomial/prtRvMultinomial</td>
            
            
         </tr>
      </table>
      <div class="title">prtRvMultinomial/prtRvMultinomial</div>
      <div class="helptext"><pre><!--helptext -->  <span class="helptopic">prtRvMultinomial</span>  Multinomial random variable
 
    RV = <span class="helptopic">prtRvMultinomial</span> creates a <span class="helptopic">prtRvMultinomial</span> object
    with an unknown number of categories with unspecified probabilities
    These properties can be set manually or by using the MLE method.
 
    <span class="helptopic">prtRvMultinomial</span> operates on count matrices. Therfore, the DRAW()
    method outputs a matrix that is N x nCategories and has a single 1
    in each row. To draw integer categories you can use the
    DRAWINTEGER() method.  Similarly, the MLE function takes a count
    matrix as an input. Type help <span class="helptopic">prtRvMultinomial</span>.mle for more
    information.
 
    RV = <span class="helptopic">prtRvMultinomial</span>(PROPERTY1, VALUE1,...) creates a
    <span class="helptopic">prtRvMultinomial</span> object RV with properties as specified by 
    PROPERTY/VALUE pairs.
 
    A <span class="helptopic">prtRvMultinomial</span> object inherits all properties from the
    prtRv class. In addition, it has the following properties:
 
    nCategories   - number of integers modeled by the RV
    probabilities - A 1 x nCategories vector of doubles less than 1
                    that sum to 1, representing the probability of
                    each of the integers
    
   A <span class="helptopic">prtRvMultinomial</span> object inherits all methods from the prtRv
   class. The MLE  method can be used to set the parameters from data.
   In addition, it has the the following methods:
    
    x = R.drawIntegers(N) - Draws N integers with the corresponding
                            probabilities
 
   Example:
   
   data = rand(100,5);                  % Uniformly random data
   X = bsxfun(@eq,data,max(data,[],2)); % Generate data that has a 
                                        % single 1 in each row
 
   RV = <span class="helptopic">prtRvMultinomial</span>;               % Generate a <span class="helptopic">prtRvMultinomial</span>
   RV = mle(RV,X);                      % Estimate the parameters
 
   RV.plotPdf()                         % Plot the pdf (pmf)</pre></div><!--after help --><!--seeAlso--><div class="footerlinktitle">See also</div><div class="footerlink"> <a href="./../prtRv.html">prtRv</a>, <a href="./../prtRvMvn.html">prtRvMvn</a>, <a href="./../prtRvGmm.html">prtRvGmm</a>, <a href="./../prtRvVq.html">prtRvVq</a>, <a href="./../prtRvKde.html">prtRvKde</a>
</div>
   </body>
</html>